package com.example.qxfw.qxxx.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.qxfw.common.entity.qx.ZwDoppler;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
@DS("qx")
public interface ZwDopplerMapper extends BaseMapper<ZwDoppler> {

    @Select("select distinct(ldtype) from zwdoppler")
    List<String> selectIdType();

    @Select("select datechar, timechar " +
            "from zwdoppler " +
            "order by datechar,timechar desc")
    List<ZwDoppler> selectMaxTime();

    @Select("select * " +
            "from zwdoppler " +
            "where datechar ='${dateChar}' and TimeChar between '${timeChar1}' and '${timeChar2}' and ldtype='${idType}' " +
            "order by datechar,timechar desc")
    List<ZwDoppler> selectList(String dateChar, String timeChar1, String timeChar2, String idType);

    @Select("select * " +
            "from zwdoppler " +
            "where (datechar ='${dateChar1}' and TimeChar>='${timeChar1}') or (datechar ='${dateChar2}' and TimeChar>='${timeChar2}') or (datechar >'${dateChar1}' and datechar <'${dateChar1}' ) and ldtype='${idType}' " +
            "order by datechar,timechar desc")
    List<ZwDoppler> selectLists(String dateChar1, String timeChar1, String dateChar2, String timeChar2, String idType);
}
